{% extends 'base/base.html' %}
{% block title %}
    首页
{% endblock %}



{% block css %}
    <style>
        .author_name {
            float: right;
            margin-right: 20px;
            color: #231dff;
        }

        .author_name1 {
            float: right;
            margin-right: 10px;
        }
        .ruanjian{
            font-size: 20px;
            margin-right: 55px;

        }


    </style>
{% endblock %}


{% block main %}
    {#        <a class="btn btn-success" href="{% url 'main:article_create' %}" role="button">写文章</a>#}
{#    {{ object_list }}#}
    {#        {{ is_paginated }}#}
{#            {{ paginator }}#}
    {#        {{ page_obj.has_previous }}#}
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
  <img style="height:450px;width: 1200px " src="https://haowallpaper.com/link/common/file/previewFileImg/17787018870181248" alt="...">
  <div class="carousel-caption">
    <h3>最大的资源互享网站</h3>
    <p>只有我知道你需要什么</p>
  </div>
</div>
    <div class="item">
      <img style="height:450px;width: 1200px " src="https://haowallpaper.com/link/common/file/previewFileImg/17187919946239360" alt="...">
      <div class="carousel-caption">
          <h3>好好运动、好好学习、好好玩耍、好好吃饭、好好休息</h3>
    <p>龟仙流流派宗旨</p>
      </div>
    </div>


      <div  class="item">
      <img style="height:450px;width: 1200px " src="https://haowallpaper.com/link/common/file/previewFileImg/17759388304395648" alt="...">
      <div class="carousel-caption">
          <h3>人生畏惧绕远的话是什么都办不到的</h3>
    <p>野原新之助</p>
      </div>
    </div>
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>







    {% for c in categorys %}
        {# 大类标题占一行 #}
        {% if c.children|length == 0 %}
        {% else %}
            <li class="list-group-item list-group-item-info">
                <strong>{{ c.title }}</strong>
            </li>
            {# 再把属于这个大类的文章逐个列出来 #}
            {% if c.children|length != 0 %}
            {% for article in c.children %}   {# 外键反向查询 #}

                <span class="ruanjian">
                 <a href="{% url 'main:category_detail' article.id %}">{{ article.title }}</a>
                </span>

            {% endfor %}
                {% else %}
                {% endif %}

        {% endif %}
    {% empty %}
        <li class="list-group-item text-muted">暂无分类</li>
    {% endfor %}
    </ul>



    {#    <ul class="list-group">#}
    {#        {% for article in object_list %}#}
    {#            <li class="list-group-item">#}
    {#                <a href=" {% url 'main:files_detail' article.id %}">{{ article.title }}</a>#}
    {#                <a class="author_name " href="">{{ article.author }}</a> <span class="author_name1 ">上传人：</span>#}
    {#            </li>#}
    {#        {% endfor %}#}
    {#    </ul>#}







    {#页码#}
    {#    {% if object_list|length > 0 %}#}
    {##}
    {#        <nav aria-label="Page navigation">#}
    {#            <ul class="pagination">#}
    {#                {% if page_obj.has_previous %}#}
    {#                    <li>#}
    {#                    <a href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">#}
    {#                {% else %}#}
    {#                    <li class="disabled">#}
    {#                    <a href="#" aria-label="Previous">#}
    {#                {% endif %}#}
    {##}
    {#                <span aria-hidden="true">&laquo;</span>#}
    {#                </a>#}
    {#                </li>#}
    {##}
    {##}
    {#                {% for pn in paginator.page_range %}#}
    {#                    {% if pn != page_obj.number %}#}
    {#                        <li><a href="?page={{ pn }}&category={{ category }}">{{ pn }}</a></li>#}
    {#                    {% else %}#}
    {#                        <li class="disabled"><a href="?page={{ pn }}&category={{ category }}">{{ pn }}</a></li>#}
    {#                    {% endif %}#}
    {#                {% endfor %}#}
    {##}
    {##}
    {#                {% if page_obj.has_next %}#}
    {#                    <li>#}
    {#                    <a href="?page={{ page_obj.next_page_number }}" aria-label="Next">#}
    {#                {% else %}#}
    {#                    <li class="disabled">#}
    {#                    <a href="#" aria-label="Next">#}
    {#                {% endif %}#}
    {##}
    {#                <span aria-hidden="true">&raquo;</span>#}
    {#                </a>#}
    {#                </li>#}
    {#            </ul>#}
    {#        </nav>#}
    {#    {% endif %}#}



{% endblock %}
